﻿<Window x:Class="SLA.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:k="http://schemas.microsoft.com/kinect/2013"
        xmlns:mui="http://firstfloorsoftware.com/ModernUI"
        WindowState="Maximized"
        WindowStyle="None"
        Title="Sign Language Aloud" Icon="Images/Icon.ico" Width="1280" Height="740" Loaded="MainWindow_Loaded" Closed="MainWindow_Closed" KeyDown="MainWindow_KeyDown">
    <!--1185-->
    <Window.Background>
        <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
            <GradientStop Color="#FFE1E0FF" Offset="1"/>
            <GradientStop Color="White" Offset="0.9"/>
        </LinearGradientBrush>
    </Window.Background>
    <k:KinectRegion x:Name="kinectRegion" IsCursorVisible="True" RenderTransformOrigin="0.5,0.5">
    	<k:KinectRegion.RenderTransform>
    		<TransformGroup>
    			<ScaleTransform/>
    			<SkewTransform/>
    			<RotateTransform/>
    			<TranslateTransform/>
    		</TransformGroup>
    	</k:KinectRegion.RenderTransform>
    	<VisualStateManager.VisualStateGroups>
    		<VisualStateGroup x:Name="VisualStateGroup">
    			<VisualStateGroup.Transitions>
    				<VisualTransition GeneratedDuration="0:0:0.5">
    					<VisualTransition.GeneratedEasingFunction>
    						<CircleEase EasingMode="EaseInOut"/>
    					</VisualTransition.GeneratedEasingFunction>
    				</VisualTransition>
    			</VisualStateGroup.Transitions>
    			<VisualState x:Name="Normal"/>
    			<VisualState x:Name="Play">
    				<Storyboard>
    					<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="grid">
    						<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
    						<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-1285"/>
    					</DoubleAnimationUsingKeyFrames>
                    </Storyboard>
    			</VisualState>
    		</VisualStateGroup>
    	</VisualStateManager.VisualStateGroups>
        <Grid>
            <Grid x:Name="grid" HorizontalAlignment="Center" VerticalAlignment="Top" Margin="5" RenderTransformOrigin="0.5,0.5">
            	<Grid.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</Grid.RenderTransform>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="Auto"/>
                </Grid.ColumnDefinitions>
                <StackPanel Width="320">
                    <Image x:Name="Logo" Margin="10" Source="Images/SLA.png"/>
                    <Grid>
                        <Grid.ColumnDefinitions>
                            <!--<ColumnDefinition Width="0.10*"/>-->
                            <ColumnDefinition Width="0.75*"/>
                            <ColumnDefinition Width="0.25*"/>
                        </Grid.ColumnDefinitions>
                        <ComboBox x:Name="cmbGestos" Margin="5" Grid.Column="0" FontSize="36" SelectionChanged="cmbGestos_SelectionChanged">
                            <!--<ComboBox.ItemTemplate>
                            <DataTemplate>
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition Width="Auto" />
                                    </Grid.ColumnDefinitions>

                                    <Label Content="{Binding Name}" Width="100" ToolTip="{Binding Name}"/>
                                    <Button Grid.Column="1" Background="#FFC5C4D2" BorderBrush="White" BorderThickness="2">
                                        <Image Source="Images/Edit.png" Width="36" Height="36" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Button>
                                    <Button Grid.Column="1">
                                        <Image Source="Images/Delete.png" Width="36" Height="36" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </Button>
                                </Grid>

                            </DataTemplate>
                        </ComboBox.ItemTemplate>-->
                        </ComboBox>
                        <Button x:Name="btnAdd" Margin="5" Click="btnAdd_Click" Grid.Column="1" Width="68" Height="58" Background="#FFC5C4D2">
                            <Image Grid.Column="0" Source="Images/Add.png" Width="36" Height="36" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </Button>
                    </Grid>
                    <k:KinectTileButton x:Name="btnCapturar" Margin="5" Click="btnCapturar_Click" Height="110" Width="Auto" Background="#FFC5C4D2" Foreground="#FF007EFF">
                        <Grid VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Margin="5" Source="Images/Capture.png" Width="36" Height="36" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Margin="5" Text="Capturar" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="#FF000000" FontSize="28"/>
                        </Grid>
                    </k:KinectTileButton>
                    <Button x:Name="btnGuardar" Margin="5" Click="btnGuardar_Click" Height="58" Width="Auto" Background="#FFC5C4D2" HorizontalContentAlignment="Left">
                        <Grid VerticalAlignment="Center" HorizontalAlignment="Left">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Margin="5" Source="Images/Store.png" Width="36" Height="36" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Margin="5" Text="Guardar" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="#FF000000" FontSize="28"/>
                        </Grid>
                    </Button>
                    <Button x:Name="btnCargar" Margin="5" Click="btnCargar_Click" Height="58" Width="Auto" Background="#FFC5C4D2" HorizontalContentAlignment="Left">
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Margin="5" Source="Images/Load.png" Width="36" Height="36" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Margin="5" Text="Cargar" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="#FF000000" FontSize="28"/>
                        </Grid>
                    </Button>
                    <Button x:Name="btnResetList" Margin="5" Click="btnResetList_Click" Visibility="Visible" Height="58" Width="Auto" Background="#FFC5C4D2" HorizontalContentAlignment="Left">
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Margin="5" Source="Images/Clean.png" Width="36" Height="36" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Margin="5" TextWrapping="Wrap" Text="Nueva Lista" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="#FF000000" FontSize="28"/>
                        </Grid>
                    </Button>
                    <Button x:Name="btnDebug" Margin="5" Click="btnDebug_Click" Visibility="Collapsed">
                        <Grid HorizontalAlignment="Left" VerticalAlignment="Center">
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="Auto"/>
                                <ColumnDefinition Width="Auto"/>
                            </Grid.ColumnDefinitions>
                            <Image Grid.Column="0" Margin="5" Source="Images/Debug.png" Width="24" Height="24" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                            <TextBlock Grid.Column="1" Margin="5" Text="Debug" HorizontalAlignment="Right" VerticalAlignment="Center"/>
                        </Grid>
                    </Button>
                    <TextBlock x:Name="lblEstado" Margin="5" TextWrapping="Wrap" FontSize="28"/>
                </StackPanel>
                <Grid Grid.Column="1" Margin="20">
                    <!--<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Bottom" Panel.ZIndex="1" HorizontalAlignment="Center" >
                    <Canvas x:Name="canvasFrame0" Width="100" Height="100" Margin="5"/>
                    <Canvas x:Name="canvasFrame19" Width="100" Height="100" Margin="5"/>
                    <Canvas x:Name="canvasFrame38" Width="100" Height="100" Margin="5"/>
                </StackPanel>-->
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0" Background="#FFe1e0ff" Orientation="Vertical" Margin="5">
                        <StackPanel Orientation="Horizontal">
                            <Canvas x:Name="canvas" Height="480" Width="640" Margin="5" Background="#FFFFFFFF" ClipToBounds="True"/>
                            <StackPanel Grid.Column="2" VerticalAlignment="Top">
                                <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <Canvas x:Name="canvasFrame0" Width="150" Height="150" Margin="0,5,5,5" Background="#FFFFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center" ClipToBounds="True"/>
                                    <StackPanel Orientation="Horizontal" Height="10" HorizontalAlignment="Left">
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="2.5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,0,0,5"/>
                                    </StackPanel>
                                    <Canvas x:Name="canvasFrame19" Width="150" Height="150" Margin="0,0,5,0" Background="#FFFFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center" ClipToBounds="True"/>
                                    <StackPanel Orientation="Horizontal" Height="10" HorizontalAlignment="Left">
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="2.5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                        <Rectangle Fill="White" Height="5" Width="5" Margin="5,5,0,0"/>
                                    </StackPanel>
                                    <Canvas x:Name="canvasFrame38" Width="150" Height="150" Margin="0,5,5,5" Background="#FFFFFFFF" HorizontalAlignment="Center" VerticalAlignment="Center" ClipToBounds="True"/>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>
                        <Grid>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="0.495*"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Vertical" Grid.Column="0" Margin="10,0,0,0">
                                <TextBlock x:Name="lblDistanciaSensor" Margin="10,5,5,5" TextWrapping="Wrap" FontSize="22" Text="Tu Distancia al Sensor" Foreground="#FF000000"/>
                                <StackPanel Orientation="Horizontal">
                                    <TextBlock x:Name="lblDistancia" Margin="10,5,5,5" TextWrapping="Wrap" FontSize="28" Foreground="#FF000000"/>
                                    <TextBlock x:Name="lblMetros" Margin="10,5,5,5" TextWrapping="Wrap" FontSize="28" Text="Mts" Foreground="#FF000000"/>
                                </StackPanel>
                            </StackPanel>
                            <CheckBox Grid.Column="1" x:Name="chkRepetirTexto" Margin="5" Content="Repetir texto" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" FontSize="14" Foreground="#FF000000" RenderTransformOrigin="0.5,0.5" Checked="chkRepetirTexto_Checked" Unchecked="chkRepetirTexto_Unchecked">
                                <CheckBox.LayoutTransform>
                                    <ScaleTransform ScaleX="2" ScaleY="2" />
                                </CheckBox.LayoutTransform>
                            </CheckBox>
                            <k:KinectTileButton Grid.Column="2" x:Name="btnPlay" Click="btnPlay_Click" Background="#FFC5C4D2" Foreground="#FF007EFF" Height="75" Width="Auto" VerticalAlignment="Top" Margin="0,-5,0,0">
                                <Image Source="Images/Play.png" Width="46" Height="46" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </k:KinectTileButton>
                        </Grid>

                        <Grid>
                            <Grid.ColumnDefinitions>
                                <!--<ColumnDefinition Width="*"></ColumnDefinition>-->
                                <ColumnDefinition Width="*"/>
                                <ColumnDefinition Width="*"/>
                            </Grid.ColumnDefinitions>
                            <StackPanel Orientation="Vertical" Grid.Column="0" Margin="10">
                                <TextBlock x:Name="lblFactorReconocimiento" Margin="10" TextWrapping="Wrap" FontSize="22" Text="Factor de Reconocimiento" Foreground="#FF000000"/>
                                <Slider x:Name="sdrDelta" Margin="5" Minimum="1" Maximum="20" ValueChanged="sdrDelta_ValueChanged" AutoToolTipPlacement="BottomRight"/>
                            </StackPanel>
                            <!--<StackPanel Orientation="Vertical" Grid.Column="1" Margin="10" Visibility="Collapsed">
                            <TextBlock x:Name="lblCantidadPalabras" Margin="10" TextWrapping="Wrap" FontSize="22" Text="Palabras para Hablar"/>
                            <Slider x:Name="sdrWords" Margin="5" Maximum="10" AutoToolTipPlacement="BottomRight" ValueChanged="sdrWords_ValueChanged"/>
                        </StackPanel>-->
                            <StackPanel Orientation="Vertical" Grid.Column="2" Margin="10">
                                <TextBlock x:Name="lblSegundosGrabar" Margin="10" TextWrapping="Wrap" FontSize="22" Text="Segundos para Grabar" Foreground="#FF000000"/>
                                <Slider x:Name="sdrSegundos" Margin="5" Maximum="20" AutoToolTipPlacement="BottomRight"/>
                            </StackPanel>
                        </Grid>
                    </StackPanel>
                </Grid>
                <StackPanel Orientation="Vertical" Grid.Column="2">
                    <TextBlock x:Name="lblArriba" Margin="10" TextWrapping="Wrap" FontSize="22" Text="Arriba" Foreground="#FF000000" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <Slider x:Name="sdrAngle" Orientation="Vertical" Margin="5" Height="430" HorizontalAlignment="Center" VerticalAlignment="Center" AutoToolTipPlacement="BottomRight" ValueChanged="sdrAngle_ValueChanged"/>
                    <TextBlock x:Name="lblAbajo" Margin="10" TextWrapping="Wrap" FontSize="22" Text="Abajo" Foreground="#FF000000" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    <k:KinectTileButton Grid.Column="0" Margin="10" x:Name="btnSwitch" Click="btnSwitch_Click" Background="{x:Null}" Foreground="#FF007EFF" Height="75" Width="Auto" VerticalAlignment="Center" BorderBrush="{x:Null}" HorizontalAlignment="Center" >
                        <StackPanel Orientation="Vertical">
                            <Image x:Name="imgRecord" Source="Images/Record.png" Width="66" Height="66" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Visible"/>
                            <Image x:Name="imgRecognize" Source="Images/Recognize.png" Width="66" Height="66" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
                        </StackPanel>
                    </k:KinectTileButton>
                </StackPanel>
            </Grid>
        </Grid>
    </k:KinectRegion>
</Window>